<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/application/appdemo/app_blog.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/application/appdemo/app_blog.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'BlogId',
                footer: "Foots",
                cnName: '博客',
                name: 'appdemo/app_blog',
                url: "/app_blog/",
                sortName: "CreateTime"
            });
            const editFormFields = ref({"Name":"","Content":""});
            const editFormOptions = ref([[{"title":"标题","field":"Name","type":"text"}],
                              [{"title":"内容","field":"Content","type":"editor"}]]);
            const searchFormFields = ref({"Name":""});
            const searchFormOptions = ref([[{"title":"标题","field":"Name","type":"like"}]]);
            const columns = ref([{field:'Name',title:'标题',type:'string',link:true,width:220,align:'left',sort:true},
                       {field:'Content',title:'内容',type:'string',width:110,align:'left'},
                       {field:'CreateDate',title:'CreateDate',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'CreateID',title:'CreateID',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Creator',title:'Creator',type:'string',width:100,hidden:true,align:'left'},
                       {field:'Modifier',title:'Modifier',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'ModifyDate',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'ModifyID',type:'int',width:100,hidden:true,align:'left'},
                       {field:'BlogId',title:'BlogId',type:'string',width:120,hidden:true,readonly:true,require:true,align:'left'}]);
            const detail = ref({
                cnName: "博客帖子",
                table: "app_post",
                columns: [{field:'Id',title:'Id',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Title',title:'回复标题',type:'string',width:220,edit:{type:'text'},align:'left',sort:true},
                       {field:'Content',title:'回复内容',type:'string',width:110,edit:{type:'editor'},align:'left'},
                       {field:'BlogId',title:'BlogId',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateDate',title:'CreateDate',type:'datetime',width:150,readonly:true,align:'left',sort:true},
                       {field:'CreateID',title:'CreateID',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Creator',title:'Creator',type:'string',width:100,readonly:true,align:'left'},
                       {field:'Modifier',title:'Modifier',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'ModifyDate',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'ModifyID',type:'int',width:100,hidden:true,align:'left'}],
                sortName: "CreateDate",
                key: "Id"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
